import { useRouteError } from '@remix-run/react';
import { Button, Result } from 'antd';
import { Link } from '@remix-run/react';

export default function ErrorPage() {
  const error = useRouteError() as any;

  return (
    <div className="h-screen flex items-center justify-center">
      <Result
        status="error"
        title="系统错误"
        subTitle={error?.message || '抱歉，系统出现了一些问题'}
        extra={
          <Link to="/">
            <Button type="primary">返回首页</Button>
          </Link>
        }
      />
    </div>
  );
}